-
Notifications
You must be signed in to change notification settings - Fork 508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Write colr atom to muxed MP4 when present in input AV1 file #1251
feat: Write colr atom to muxed MP4 when present in input AV1 file #1251
Conversation
uint16_t transfer_characteristics, | ||
uint16_t matrix_coefficients, | ||
uint8_t video_full_range_flag) const { | ||
return base::StringPrintf( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A link to https://aomediacodec.github.io/av1-isobmff/#codecsparam here would be really helpful, IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that #1205 this needs to be rebased |
9f2b379
to
71d68b4
Compare
Rebased! :) @cosmin |
@@ -429,6 +430,36 @@ bool MP4Muxer::GenerateVideoTrak(const VideoStreamInfo* video_info, | |||
VideoSampleEntry video; | |||
video.format = | |||
CodecToFourCC(video_info->codec(), video_info->h26x_stream_format()); | |||
if (video.format == FOURCC_av01) { | |||
auto av1_color_info = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
having to parse these back out of the codec string doesn't feel like the right solution
Re-published as PR#1261, with an improved and more stable implementation. |
This PR is an extension of the full AV1 codec string feature: PR 1205 and relates to Issue 1007 and Issue 1202.
As per the AV1 spec, the codec string may contain optional color values. These color values are critical for detecting HDR video streams - see Issue 1007. Color information is extracted from the input mp4's
colr
atom and used to generate the full AV1 codec string. This PR preserves the color information by writing thecolr
atom to the muxed mp4.References:
Specification - Section 6.4.2 Color config semantics (page 117)
Testing
Manual: AV1 video WITH colr atom
Note: Presence of the colr atom in
bbbhdr_av1.mp4
was verified with a hex editor../out/Release/packager in=~/Downloads/bbbhdr_av1.mp4,stream=video,output=av1_with_colr.mp4 --mpd_output av1_with_colr.mpd
av1_with_colr.mp4
bitstream for thecolr
atom and cross reference the values of the atom's properties with the codec representation string found in the manifest:Format
git clang-format --style Chromium --binary /usr/bin/clang-format 80e024013df87a4bfeb265c8ea83cfa2a0c5db0f